/*
 * mmio.c
 *
 * @author  Philippe Johnson
 */

#include "common.h"
#include "mmio.h"
#include "mmiotable.h"
#include "memory.h"

void initializeMMIO() {
    int i = 0;
    while( entryTable[ i ].address != 0x0000 ) {
        /* Fill out the table */
        if( entryTable[ i ].type == WRITE ) {
            mmioWriteHandlers[ MMIOHASH( entryTable[ i ].address ) ] = 
                entryTable[ i ].handler;
        } else {
            mmioReadHandlers[ MMIOHASH( entryTable[ i ].address ) ]  = 
                entryTable[ i ].handler;
        }
    }
}

u32 invalidMMIOCall( u32 address, u8 size, u32 value ) {
    DEBUGMSG( "Invalid or unimplemented MMIO call at $%x\n", address );

    return 0;
}
